<script setup lang="ts">
//维修报价
import { ref } from "vue";
//https://www.smartisan.com/support/#/serviceprice
import Services from "@/base/service/service.vue";
import Consult from "@/base/service/page/consult.vue";

//选项
const activeTab = ref(0);
//列表
const tabs = [
  { title: "热点咨询专题", component: Consult },
  { title: "预约购买咨询", component: Consult },
  { title: "订单物流咨询", component: Consult },
  { title: "日常使用解答", component: Consult },
  { title: "月度统计", component: Services },
];
//切换
const changeTab = (index: number) => {
  activeTab.value = index;
};
</script>
<template>
  <div class="section serviceprice">
    <div class="container">
      <div class="aside sticky-nav">
        <h1>服务与支持</h1>
        <ul>
          <li
            v-for="(item, index) in tabs"
            :key="index"
            :class="{ active: activeTab === index }"
            @click="changeTab(index)"
          >
            <a>{{ item.title }}</a>
          </li>
        </ul>
        <span class="question-btn">
          <a class="question">在线咨询</a>
        </span>
      </div>
      <div class="content">
        <div class="title-box">
          <h1>简简单单的标题</h1>
        </div>
        <div class="inner">
          <component :is="tabs[activeTab].component" />
        </div>
      </div>
    </div>
  </div>
</template>
<style scoped lang="less">
.section {
  padding-top: 40px;
  padding-bottom: 50px;
}
.container {
  width: 1220px;
  margin-left: auto;
  margin-right: auto;
}
.aside,
.support-navWrap {
  position: relative;
}
.aside {
  li:before,
  ul:before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    border-bottom: 1px solid #e5e5e5;
    z-index: 1;
  }
}

.aside {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #dcdcdc;
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: 0 3px 8px -6px rgba(0, 0, 0, 0.1);
  float: left;
  margin-right: 18px;
  h1 {
    height: 60px;
    line-height: 60px;
    padding: 0 10px 0 28px;
    background: #f5f5f5;
    background: linear-gradient(#fff, #f5f5f5);
    border-bottom: 1px solid #dcdcdc;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 1px 7px rgba(0, 0, 0, 0.06);
    color: #646464;
    font-size: 18px;
  }
  li {
    position: relative;
    line-height: 50px;
    list-style: none;
    width: 212px;
    a:hover {
      color: #fff;
      font-weight: bolder;
      background: #6785d9;
    }
  }
  a {
    display: block;
    padding-left: 30px;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s ease-out;
  }
}

.serviceprice :deep(.content) {
  display: block;
  padding-bottom: 0;
  overflow: visible;
  margin-left: 230px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: 0 3px 8px -6px rgba(0, 0, 0, 0.1);
  h1 {
    margin-bottom: 0;
  }
}

.question-btn {
  overflow: hidden;
  display: inline-block;
  position: absolute;
  bottom: -65px;
  left: 0;
  right: 0;
  background: #5f7ed7;
  background: linear-gradient(#6e98f4, #4b77ee);
  cursor: pointer;
  border-radius: 8px;
  height: 45px;
  border: 1px solid #3f6aec;
  line-height: 45px;
  text-align: center;
  .question {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    height: 45px;
    display: inline-block;
    padding: 0 15px 0 38px;
    background: url()
      left 10px top 13px no-repeat;
    background-size: 18px;
  }
}
.question-btn:hover {
  background: #597cd2;
  background-image: linear-gradient(#6687d6, #4b6dcb);
}

//右侧内容
.content {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #dcdcdc;
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: 0 3px 8px -6px rgba(0, 0, 0, 0.1);
  padding-bottom: 30px;
  overflow: hidden;
}
.serviceprice .content {
  padding-bottom: 0;
  h1 {
    height: 60px;
    line-height: 60px;
    padding: 0 10px 0 28px;
    background: #f5f5f5;
    background: linear-gradient(#fff, #f5f5f5);
    border-bottom: 1px solid #dcdcdc;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 1px 7px rgba(0, 0, 0, 0.06);
    color: #646464;
    font-size: 18px;
  }

  .title-box {
    border-bottom: 1px solid #cfcfcf;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.12);
    background: url(//static.smartisanos.cn/support/assets/images/step-order-box-title-bg.1452a46….jpg)
      repeat-x;
    position: relative;
    height: 60px;
    z-index: 5;
    h1 {
      line-height: 60px;
      font-size: 18px;
      margin-bottom: 0;
      z-index: 0;
      border-bottom: 0;
      box-shadow: 0 0 transparent;
      padding-left: 30px;
      float: left;
    }
  }
}
.content {
  :deep(h2) {
    background: #e6e7e8;
    line-height: 40px;
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 20px;
  }
  :deep(p) {
    margin-bottom: 20px;
  }
}

.content :deep(h1),
.content :deep(h2),
.content :deep(h3),
.content :deep(h4),
.content :deep(h5),
.content :deep(h6) {
  padding: 0 30px;
}

.content :deep(dd),
.content :deep(dt),
.content :deep(li),
.content :deep(p) {
  padding: 0 30px;
  line-height: 1.857142857142857;
}
</style>
